package com.wltt.product.frfront.controller;

import com.wltt.product.frfront.model.ResultData;
import com.wltt.product.frfront.model.vo.CommonWeldPostCheckREQ;
import com.wltt.product.frfront.model.vo.CommonWeldREQ;
import com.wltt.product.frfront.model.vo.WeldREQ;
import com.wltt.product.frfront.service.WeldService;
import jakarta.annotation.Resource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/api/weld")
public class WeldController {

    private static final Logger logger = LogManager.getLogger(WeldController.class);

    @Resource
    private WeldService weldService;

    /**
     * 正向送丝
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/forwardWireFeed"}, method = RequestMethod.POST)
    public ResultData forwardWireFeed() {
        return weldService.forwardWireFeed();
    }

    /**
     * 正向送丝停止
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/stopForwardWireFeed"}, method = RequestMethod.POST)
    public ResultData stopForwardWireFeed() {
        return weldService.stopForwardWireFeed();
    }

    /**
     * 反向送丝
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/reverseWireFeed"}, method = RequestMethod.POST)
    public ResultData reverseWireFeed() {
        return weldService.reverseWireFeed();
    }

    /**
     * 反向送丝停止
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/stopReverseWireFeed"}, method = RequestMethod.POST)
    public ResultData stopReverseWireFeed() {
        return weldService.stopReverseWireFeed();
    }

    /**
     * 气体检测
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/airCheck"}, method = RequestMethod.POST)
    public ResultData airCheck() {
        return weldService.airCheck();
    }

    /**
     * 快速直线焊接
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/fastLineWeld"}, method = RequestMethod.POST)
    public ResultData fastLineWeld(@RequestBody WeldREQ weldREQ) {
        return weldService.fastLineWeld(weldREQ);
    }

    /**
     * 快速圆弧焊接
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/fastArcWeld"}, method = RequestMethod.POST)
    public ResultData fastArcWeld(@RequestBody WeldREQ weldREQ) {
        return weldService.fastArcWeld(weldREQ);
    }

    /**
     * 直线组合焊接
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/lineGroupWeld"}, method = RequestMethod.POST)
    public ResultData lineGroupWeld(@RequestBody WeldREQ weldREQ) {
        return weldService.lineGroupWeld(weldREQ);
    }

    /**
     * 直线圆弧组合焊接
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/lineAndArcGroupWeld"}, method = RequestMethod.POST)
    public ResultData lineAndArcGroupWeld(@RequestBody WeldREQ weldREQ) {
        return weldService.lineAndArcGroupWeld(weldREQ);
    }

    /**
     * 分段组合焊接
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/paragraphGroupWeld"}, method = RequestMethod.POST)
    public ResultData paragraphGroupWeld(@RequestBody WeldREQ weldREQ) {
        return weldService.paragraphGroupWeld(weldREQ);
    }

    /**
     * 通用组合焊接
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/commonGroupWeld"}, method = RequestMethod.POST)
    public ResultData commonGroupWeld(@RequestBody CommonWeldREQ commonWeldREQ) {
        return weldService.commonGroupWeld(commonWeldREQ);
    }

    /**
     * 通用组合焊接点位校验
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/commonGroupWeldPostCheck"}, method = RequestMethod.POST)
    public ResultData commonGroupWeldPostCheck(@RequestBody CommonWeldPostCheckREQ commonWeldPostCheckREQ) {
        return weldService.commonGroupWeldPostCheck(commonWeldPostCheckREQ);
    }

    /**
     * 停止焊接接口
     *
     * @return
     */
    @ResponseBody
    @RequestMapping(value = {"/stopWeld"}, method = RequestMethod.POST)
    public ResultData stopWeld() {
        return weldService.stopWeld();
    }

}
